import actionType from "../actions";
let initState = { list: [] };

let addboxReducer = (state = initState, action: any) => {
  switch (action.type) {
    case actionType.ADDBOX: //添加盒子数据
      return { list: [...state.list, action.playload] };
    case actionType.DELBOX: //删除盒子数据
      return { list: state.list.filter((item: any) => item.id != action.playload) };
    default:
      return state;
  }
  // return state;
};
export default addboxReducer;
